package com.ruoyi.user.controller.app;


import com.ruoyi.common.core.constant.constant.PathConstant;
import com.ruoyi.common.core.pojo.vo.SingleVO;
import com.ruoyi.common.core.result.Result;
import com.ruoyi.user.service.IAttentionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Tag(name = "App-用户关注相关", description = "App-用户关注相关")
@RestController
@RequestMapping(PathConstant.APP_PATH + "user-attention")
public class AppUserAttentionController {
    @Autowired
    private IAttentionService iAttentionService;


    @Operation(summary = "内部调用获取他人用户信息", description = "内部调用获取他人用户信息")
    @GetMapping("setAttention/{userId}/{aimUserId}/{intimacyNum}")
    public SingleVO<Integer> getUserById(@PathVariable("userId") Long userId, @PathVariable("aimUserId") Long aimUserId, @PathVariable("intimacyNum") Integer intimacyNum) {
        return Result.single(iAttentionService.attention(userId, aimUserId, intimacyNum));
    }


    @Operation(summary = "内部调用是否是粉丝", description = "内部调用是否是粉丝")
    @GetMapping("isMyFens/{userId}/{aimUserId}")
    public SingleVO<Integer> isMyFens(@PathVariable("userId") Long userId, @PathVariable("aimUserId") Long aimUserId) {
        return Result.single(iAttentionService.isMyFens(userId, aimUserId));
    }

}

